MessageBox.Show("Some text", "Some title", MessageBoxButtons.OK, MessageBoxIcon.Error);
try { test(); } catch (Exception ex) { MessageBox.Show(ex.Message); }